package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.IMonitorParamTimingDAO;
import org.jsbd.boss.domian.MonitorParam;
import org.jsbd.boss.domian.MonitorParamVO;
import org.springframework.stereotype.Repository;

import edu.hziee.common.dbroute.BaseDAO;

@Repository("monitorParamTimingDAO")
public class MonitorParamTimingDAOImpl extends BaseDAO implements IMonitorParamTimingDAO {

	@Override
	public Map<String, Object> findDataWithPage(DataGridModel page, MonitorParamVO mvo) {
		mvo = (mvo == null ? new MonitorParamVO() : mvo);
		mvo.setPageInfo(page);
	    Map<String, Object> results = new HashMap<String, Object>();
	    results.put("total", super.queryForCount("qy_channel_monitor_param.SELECT_COUNT_WITH_CONDITION", mvo));
	    results.put("rows", super.queryForList("qy_channel_monitor_param.SELECT_LIST_WITH_CONDITION", mvo));
	    return results;
	}

	@Override
	public void insert(MonitorParam monitorParam) {
		super.insert("qy_channel_monitor_param.INSERT", monitorParam);
	}

	@Override
	public void delete(Integer id) {
		super.update("qy_channel_monitor_param.DELETE", id);
	}

	@Override
	public List<MonitorParam> selectDeltaData(int offset) {
		return super.queryForList("qy_channel_monitor_param.SELECT_DELTA_DATA", offset);
	}

	@Override
	public void updateIsExecute(List<MonitorParam> monitorParams) {
		super.batchUpdate("qy_channel_monitor_param.UPDATE_IS_EXECUTE", monitorParams);
	}

	@Override
	public MonitorParam findMonitorParamById(Integer id) {
		return (MonitorParam) super.queryForObject("qy_channel_monitor_param.SELECT_MONITOR_PARAM_BY_ID", id);
	}

	@Override
	public void modifyMonitorParam(MonitorParam monitorParam) {
		super.update("qy_channel_monitor_param.UPDATE_MONITOR_PARAM", monitorParam);
	}

}
